﻿@model IEnumerable<Doan.Forum.Models.Category>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@if (ViewBag.AlertMessage != null)
{
    <div class="alert alert-block fade in alert-info">
        <a href="#" data-dismiss="alert" class="close">&times;</a>
        @ViewBag.AlertMessage
    </div>
}

@foreach(var item in Model)
{
    switch(item.CategoriId %7)
     {
        case 0: 
             <div class="tile one limebg">
                 <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                     <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                     <div class="right rightcategory">
                         @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                         <br/>
                         @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                     </div>
                 </a>
             </div>
             break;
         case 1: 
         <div class="tile two-h orangebg">
                     <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                         <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                         <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                     </a>
                 </div>
            break;
        case 2: 
             <div class="tile one seagreenbg">
                 <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                     <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                     <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                    </div>
                 </a>
             </div>
            break;
         case 3: <div class="tile two-h bluebg">
                     <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                         <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                         <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                     </a>
                 </div>
            break;
         case 4: <div class="tile two-h brownbg">
                     <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                         <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                         <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                     </a>
                 </div>
            break;
         case 5: <div class="tile two-h tealbg">
                     <a href=@Url.Action("SubCategoryList", "Home", new {id= item.CategoriId})>
                         <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                         <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                     </a>
                 </div>
            break;
         case 6: <div class="tile one purplebg">
                     <a href=@Url.Action("SubCategoryList", "Home", new { id = item.CategoriId })>
                         <div class="left">
                         <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         <h4>@item.CategoryName</h4>
                     </div>
                         <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                     </a>
                 </div>
            break;
         default: <div class="tile one bluebg">
                      <a href=@Url.Action("SubCategoryList", "Home", new { id = item.CategoriId })>
                          <div class="left">
                             <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                             <h4>@item.CategoryName</h4>
                         </div>
                          <div class="right rightcategory">
                             @item.Category1.Select(x=>x.Topics.Count).Sum() Chủ đề
                             <br/>
                             @item.Category1.Select(x=>x.Topics.Select(y=>y.Comments.Count).Sum()).Sum() Bình luận
                         </div>
                      </a>
                  </div>
            break;
     }
}
